Skip to content

Allow require of nativescript-cli as library #2468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2017

Conversation

rosen-vladimirov
Copy link
Contributor

The entry point of current cli is used only from bin/tns. In fact the main entry in package.json is used when you want to require the module, but CLI is never required. It's installed globally and spawned from it's bin dir (bin key in package.json defines which is the "entry" point when package is installed globally).
So I've changed the entry point to a file, that does not use commandDispatcher - when requiring {N} CLI as library, we'll not execute commands.
In order to allow executing specific device operations (like device detection through events), require the mobile-cli-lib's appbuilder bootstrap in the entry point. This will be fixed with other PR's and finally we'll not have to require this bootstrap.

@rosen-vladimirov rosen-vladimirov added this to the 2.6.0 (TBD) milestone Feb 1, 2017
@rosen-vladimirov rosen-vladimirov self-assigned this Feb 1, 2017
The entry point of current cli is used only from `bin/tns`. In fact the `main` entry in package.json is used when you want to require the module, but CLI is never required. It's installed globally and spawned from it's bin dir (`bin` key in package.json defines which is the "entry" point when package is installed globally).
So I've changed the entry point to a file, that does not use commandDispatcher - when requiring {N} CLI as library, we'll not execute commands.
In order to allow executing specific device operations (like device detection through events), require the mobile-cli-lib's appbuilder bootstrap in the entry point. This will be fixed with other PR's and finally we'll not have to require this bootstrap.
@rosen-vladimirov rosen-vladimirov merged commit 9b0f965 into master Feb 1, 2017
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/require-cli branch February 1, 2017 14:22
@Plamen5kov Plamen5kov modified the milestones: 3.0.0, 2.6.0 (TBD) Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants